From: Lucas Werkmeister Date: Thu, 11 Feb 2021 18:35:07 +0000 (+0100) Subject: runDialog: Let history trim input X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~357 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=df94055c58f312640a984ad7e94565850e0f458f;p=gnome-shell.git runDialog: Let history trim input Checking whether the item is empty is now the history’s job, per the previous commit. The history also returns the trimmed input for us, so we can avoid doing that work twice. Part-of: --- diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index a01af5c9d..bc9689d4d 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -178,11 +178,9 @@ class RunDialog extends ModalDialog.ModalDialog { } _run(input, inTerminal) { - input = input.trim(); + input = this._history.addItem(input); // trims input let command = input; - if (input) - this._history.addItem(input); this._commandError = false; let f; if (this._enableInternalCommands)